<?php

namespace Apps\Common\Enum;


class OrderState extends Enum
{
    /**
     * 已经退款
     */
    const Refund = -10;
    /**
     * 删除
     */
    const Delete = -2;
    /**
     * 取消
     */
    const Cancel = -1;
    /**
     * 等待支付
     */
    const WaitPay = 0;
    /**
     * 支付同步返回
     */
    const PayReturn = 1;
    /**
     * 支付完成
     */
    const PayNotice = 2;
    /**
     * 已经兑换
     */
    const Exchange = 10;

    public static function valuesExplain()
    {
        return [
            '-1' => '取消',
            '-2' => '删除',
            '-10' => '已退款',
            '0' => '待支付',
            //'1' => '支付同步返回',
            '2' => '已支付',
            '10' => '已兑换',
        ];
    }

    public static function valueToStr($k)
    {
        $data = self::valuesExplain();
        $key = strval($k);
        return isset($data[$key]) ? $data[$key] : '';
    }
}